Retry fetch when an idle H2 session socket closes#5388
Conversation
Signed-off-by: marko1olo <barsukdana@gmail.com>
0ffdbd8 to
f4fbca7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5388 +/- ##
=======================================
Coverage 93.25% 93.26%
=======================================
Files 110 110
Lines 36752 36803 +51
=======================================
+ Hits 34274 34325 +51
Misses 2478 2478 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| if (request.body != null) { | ||
| request.body = safelyExtractBody(request.body.source)[0] |
There was a problem hiding this comment.
this safelyExtractBody call can throw if the body source was already consumed or is not extractable (e.g. a ReadableStream). since we are already inside a catch handler, a throw here would bypass the rest of the error handling and propagate as an unhandled rejection. worth wrapping in a try/catch that falls through to the normal error path.
| for (const socket of sockets) { | ||
| socket.destroy() | ||
| } | ||
|
|
There was a problem hiding this comment.
server.close() here is not awaited. the rest of the tests in this file use closeClientAndServerAsPromise which properly waits for the server to close. if the server is still handling connections during teardown this could cause "async activity after test" warnings.
Summary
ECONNRESET,EPIPE,UND_ERR_SOCKET)Fixes #3492
Tests
node --test ./test/fetch/http2.jsnpm run lint -- lib/web/fetch/index.js test/fetch/http2.jsnpm run test:h2:fetchgit diff --check